//
//  aboutUs.m
//  美物说
//
//  Created by J on 15/8/28.
//  Copyright (c) 2015年 JZJ. All rights reserved.
//

#import "aboutUs.h"
#import <MessageUI/MessageUI.h>


@interface aboutUs ()<MFMailComposeViewControllerDelegate>
@property (weak, nonatomic) IBOutlet UILabel *appName;

@end

@implementation aboutUs



- (void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:YES];
    
    _appName.text=[NSString stringWithFormat:@"漫画 %@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]];
    _appName.textColor=[UIColor colorWithRed:253/255.0 green:173/255.0 blue:20/255.0 alpha:1.0];
    _appName.font=[UIFont systemFontOfSize:14];


}
- (void)mailComposeController:(MFMailComposeViewController*)controller
          didFinishWithResult:(MFMailComposeResult)result
                        error:(NSError*)error {
    switch (result)
    {
        case MFMailComposeResultCancelled:
            NSLog(@"Mail send canceled...");
            break;
        case MFMailComposeResultSaved:
            NSLog(@"Mail saved...");
            break;
        case MFMailComposeResultSent:
            NSLog(@"Mail sent...");
            break;
        case MFMailComposeResultFailed:
            NSLog(@"Mail send errored: %@...", [error localizedDescription]);
            break;
        default:
            break;
    }
    [self dismissModalViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    

    
    
    
}
- (IBAction)version:(UIButton*)sender {
    
    MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
    mc.mailComposeDelegate = self;
    
    
    
    //设置委托
    mc.mailComposeDelegate = self;
    //设置邮件主题
    [mc setSubject:@"Hello World!"];
    
    
    [mc setMessageBody:nil isHTML:NO];
    
    //    //设置收件人
        [mc setToRecipients:[NSArray arrayWithObjects:@"1140752635@qq.com"]];
    
    
    //设置cc
        [mc setCcRecipients:[NSArray arrayWithObjects:@"1140752635@qq.com"]];
    //    //设置bcc
        [mc setBccRecipients:[NSArray arrayWithObjects:@"1140752635@qq.com"]];

    
    
    [self presentModalViewController:mc animated:YES];
    
    
//   //
//
//    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
